import React, { Component } from 'react';
import { StyleSheet, View,Text,Image,Dimensions,TouchableWithoutFeedback } from 'react-native';

import Icon from 'react-native-vector-icons/FontAwesome';
import AppStyle from '../styles/index';

import {txt,view} from '../comm/Size';

import { Divider} from 'react-native-elements'

export default class SideMenuBar extends Component {

    constructor(props) {
        super(props);
        this.state = {};
    }

    render() {
        return <View style={styles.container}>
            <View style={styles.logoContainer}>
                <Image style={styles.logo} source={require('../assets/logo.jpg')}></Image>
            </View>
            <TouchableWithoutFeedback onPress={()=>{this.props.navigation.navigate('LoginPage')}}>
                <View>
                    <Text style={styles.appBtn}>
                        <Icon name="user">个人信息</Icon>
                    </Text>
                </View>
            </TouchableWithoutFeedback>
            <Divider style={{ backgroundColor: AppStyle.grayColor,marginHorizontal:20 }}/>
            <TouchableWithoutFeedback onPress={()=>{this.props.navigation.navigate('LoginPage')}}>
                <View>
                    <Text style={styles.appBtn}>
                        <Icon name="sign-out">注销登录</Icon>
                    </Text>
                </View>
            </TouchableWithoutFeedback>
        </View>
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: "#333333",
        paddingBottom: 20
    },
    toolbar: {
        height: 30,
        backgroundColor: AppStyle.mainColor,
        justifyContent: "center",
        paddingLeft: 10
    },
    logoContainer: {paddingBottom: 20},
    logo: {
        marginTop: view(80),
        height: view(180),
        width: view(180),
        borderRadius: view(180),
        alignSelf: "center"
    },
    appBtn: {
        paddingTop: view(14),
        paddingBottom: view(14),
        color: AppStyle.mainColor,
        width: 120,
        fontSize:26,
        textAlign: "center",
        marginVertical: view(10)
    }
})